//    GString *json_string = CreateJsonValue();
//    gchar *Result = HttpJsonPost("http://localhost/ENGINEER/json/file/index.php",json_string);
//    g_printf("%s",Result);

//GString *parameter = g_string_new(NULL);
//g_string_printf(parameter,"%s",SetPostBody("USERNAME","tang","PASSWD","123qwe"));
//gchar *Result = HttpValuePost("localhost:81/json/login/", parameter);

//json_object *string_to_json = json_tokener_parse((const char*)Result);
//g_printf("%s\n",ReturnJsonValue(string_to_json));
//struct json_object *result_object = NULL;

//result_object =  json_object_object_get(string_to_json,"username");
//const gchar *username = json_object_to_json_string(result_object);

//result_object =  json_object_object_get(string_to_json,"token");
//const gchar *passwd = json_object_to_json_string(result_object);

//g_printf("USER: %s\n",(gchar *)username);
//g_printf("PASSWD: %s\n",(gchar *)passwd);

////HttpFilePost
//    GHashTable *hashtable = g_hash_table_new(g_str_hash,g_str_equal);
//    g_hash_table_insert(hashtable, "filename","test");
//    g_print("%s\n",HttpFilePost("http://localhost:8080/upload/file/","file","/home/tang/HANDMAN.txt",hashtable));

////HttpFileGet_ByJson
//    GString *json_string = CreateResourceJsonValue();
//    HttpGetResourceByJson("http://localhost:8080/file/jget/",json_string,"/tmp/1.jpg");

////GString *CreateJsonValue(){
////    GString *result  = g_string_new(NULL);;
////    json_object *json_obj = json_object_new_object();
////    json_object_object_add(json_obj,"requestType",json_object_new_string("Linux Ubuntu 14.04 Dolphin Client"));

////    json_object *requestbody = json_object_new_object();
////    json_object_object_add(requestbody,"name",json_object_new_string("tang"));

////    json_object_object_add(json_obj,"data",requestbody);

////    g_string_printf(result,"%s",ReturnJsonValue(json_obj));
////    return result;
////}

////GString *CreateResourceJsonValue(){
////    //fileUrl:http://localhost:8080/file/get/testmp4.mp4
////    GString *result  = g_string_new(NULL);;
////    json_object *json_obj = json_object_new_object();
////    json_object_object_add(json_obj,"requestType",json_object_new_string("Linux Ubuntu 14.04 Dolphin Client"));

////    json_object *requestbody = json_object_new_object();
////    json_object_object_add(requestbody,"fileUrl",json_object_new_string("http://localhost:8080/file/get/1.jpg"));

////    json_object_object_add(json_obj,"data",requestbody);

//    g_string_printf(result,"%s",ReturnJsonValue(json_obj));
//   return result;
//}
//
//static GMutex test_g_mutex_mutex;
//static gboolean test_g_mutex_thread_ready;
//static guint test_g_mutex_int = 0;
//G_LOCK_DEFINE_STATIC (test_g_mutex);

//static gpointer
//test_g_mutex_thread (gpointer data)
//{
//    g_assert (GPOINTER_TO_INT (data) == 42);
//    g_assert (g_mutex_trylock (&test_g_mutex_mutex) == FALSE);
//    g_assert (G_TRYLOCK (test_g_mutex) == FALSE);
//    test_g_mutex_thread_ready = TRUE;
//    g_mutex_lock (&test_g_mutex_mutex);
//    test_g_mutex_int = -42;
//    g_message("[mutex_thread]Value: %d",test_g_mutex_int);
//    g_mutex_unlock (&test_g_mutex_mutex);
//    return GINT_TO_POINTER (-1);
//}

//static void
//test_g_mutex (void)
//{
//    GThread *thread;
//    g_message("Try to lock mutex: %d",g_mutex_trylock (&test_g_mutex_mutex));
//    G_TRYLOCK (test_g_mutex);
//    test_g_mutex_thread_ready = FALSE;
//    thread = g_thread_create (test_g_mutex_thread, GINT_TO_POINTER (42),
//                              TRUE, NULL);
//    while (!test_g_mutex_thread_ready){
//        g_message("[main thread]Value: %d",test_g_mutex_int);
//        g_usleep (G_USEC_PER_SEC / 5);
//    }
//    test_g_mutex_int = 42;
//    G_UNLOCK (test_g_mutex);
//    g_mutex_unlock (&test_g_mutex_mutex);
//    GPOINTER_TO_INT (ThreadJoin (thread)) == 41;
//}

//D_ThreadObj *thread_obj = NewThreadCreate("obj",(GThreadFunc)NewThreadFuncCreate,(gpointer)"pointer");

//void NewThreadFuncCreate(gpointer data){
//    g_print("data is: %s\n",(gchar *)data);
//}

//void Pool_NewThreadFuncCreate(gpointer data, gpointer user_data){
//    g_print("data is: %s\n",(gchar *)data);
//    g_print("user_data is: %s\n============================\n",(gchar *)user_data);
//}

//GError *error = NULL;
//D_ThreadPool *thread_pool = DownloadFilePool(Pool_NewThreadFuncCreate,"HELLO",&error);
//int count = 0;
//for(count;count<5;count++){
//    gchar *teststr = g_strdup_printf("value is: %d",count);
//    ThreadPoolPush(thread_pool,(gpointer)teststr,&error);
//}
//DestroyThreadPool(thread_pool);
//return (0);

